package com.orifine.orm.spring;

import org.springframework.beans.factory.InitializingBean;

import com.orifine.orm.SqlScriptFactory;
import com.orifine.orm.SqlScriptGenerator;


public class SqlScriptFactoryBean extends SqlScriptFactory implements InitializingBean {
	private String generatorClassString = "com.orifine.orm.mysql.MySqlScriptGenerator";

	public void setGenerator(String generatorClassString) {
		this.generatorClassString = generatorClassString;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		setSqlScriptGenerator((SqlScriptGenerator) Class.forName(generatorClassString).newInstance());
		getSqlScriptGenerator().setInfoMaxSize(getInfoMaxSize());
	}
}
